| 1 |
|
| 2 |
|
| 3 |
Das_Watchdog V0.9.0 |
| 4 |
Released 14.2.2009 |
| 5 |
|
| 6 |
Kjetil S. Matheussen, [email protected] |
| 7 |
|
| 8 |
|
| 9 |
ABOUT |
| 10 |
----- |
| 11 |
Das_Watchdog is a general watchdog for the linux operating system that |
| 12 |
should run in the background at all times to ensure a realtime process |
| 13 |
won't hang the machine. |
| 14 |
|
| 15 |
Das_Watchdog is inspired by the rt_watchdog program |
| 16 |
made by Florian Schmidt: http://tapas.affenbande.org/?page_id=38 |
| 17 |
|
| 18 |
But das_watchdog has some improvements over rt_watchdog: |
| 19 |
|
| 20 |
1. It works with 2.4 kernels as well as 2.6. |
| 21 |
2. Instead of permanently setting all realtime processes to run non-realtime, das_watchdog |
| 22 |
only sets them temporary. |
| 23 |
3. When the watchdog kicks in, an X window should pop up that tells you whats happening. |
| 24 |
(just close it after reading the message). |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
REQUIREMENTS |
| 29 |
------------ |
| 30 |
xmessage (should be a part of X11) |
| 31 |
libgtop2 (should be included with gnome. No, das_watchdog is not a gnome-program, it |
| 32 |
only uses libgtop2.) |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
COMPILATION |
| 37 |
---------- |
| 38 |
make |
| 39 |
|
| 40 |
|
| 41 |
FEDORA INSTALLATION |
| 42 |
------------------- |
| 43 |
cp das_watchdog /usr/local/sbin/ |
| 44 |
echo '/usr/local/sbin/das_watchdog >/dev/null &' >>/etc/rc.sysinit |
| 45 |
reboot |
| 46 |
|
| 47 |
|
| 48 |
GENTOO INSTALLATION |
| 49 |
------------------- |
| 50 |
# from the proaudio repository: |
| 51 |
emerge -va das_watchdog |
| 52 |
reboot |
| 53 |
|
| 54 |
|
| 55 |
DEBIAN INSTALLATION |
| 56 |
------------------- |
| 57 |
cp das_watchdog /usr/local/sbin/ |
| 58 |
cp das_watchdog.rc /etc/init.d/das_watchdog |
| 59 |
update-rc.d das_watchdog defaults |
| 60 |
invoke-rc.d das_watchdog start |
| 61 |
reboot |
| 62 |
|
| 63 |
|
| 64 |
USAGE |
| 65 |
----- |
| 66 |
|
| 67 |
Whenever a program locks up the machine, the watchdog temporarily sets all |
| 68 |
realtime process to non-realtime for 8 seconds. You will get an xmessage window |
| 69 |
up on the screen whenever that happens. |
| 70 |
|
| 71 |
To test it, run the attached program "test_rt", which immediatley freezes your |
| 72 |
machine. However, a window should pop up after about 5-6 seconds telling you |
| 73 |
that the watchdog set the process to non-realtime. (If you have two processors, |
| 74 |
you must run test_rt two times, and so on.) |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
CHANGES |
| 82 |
------- |
| 83 |
0.3.2->0.9.0 |
| 84 |
* Removed timer process testing. This was only a problem with older 2.6 |
| 85 |
kernels. (think it was fixed early 2006 or thereabout). No scary |
| 86 |
messages printed to the screen anymore. |
| 87 |
* Tested on Fedora core 10. |
| 88 |
* Cleaned up documentation a bit and added instructions for installing on |
| 89 |
Fedora, Gentoo and Debian. |
| 90 |
|
| 91 |
0.3.1->0.3.2 |
| 92 |
*Fixed manual. Newer linux kernels all seems to have properly working timing, so using |
| 93 |
the --force option should never be necessary anymore. |
| 94 |
|
| 95 |
0.2.5->0.3.1 |
| 96 |
*Changed scheme for finding correct XAUTHORITY environment variable. |
| 97 |
(Now works with Fedora Core 6) |
| 98 |
Hopefully, these changes should increase the chance of seeing the |
| 99 |
xmessage and avoid seeing multiple ones. (Theres no correct way to do |
| 100 |
this, so please send me the output of "uname -a" in case you don't see |
| 101 |
any window) |
| 102 |
*Added syslogging. |
| 103 |
*Added the --version argument. |
| 104 |
|
| 105 |
0.2.4->0.2.5 |
| 106 |
*Let the test thread run with SCHED_FIFO priority as well, using the lowest priority. |
| 107 |
|
| 108 |
0.2.3->0.2.4 |
| 109 |
*Test if the xmessage program found during the make process is a valid executable. |
| 110 |
If not, search the $PATH instead. This should fix it for Gentoo when the pro-audio |
| 111 |
overlay is updated to at least this version. |
| 112 |
*Various modifications for the High Res Timer, which should be used instead of setting the |
| 113 |
timer interrupt process to SCHED_FIFO/99. |
| 114 |
|
| 115 |
0.2.2->0.2.3 |
| 116 |
*Fixed commandline arguments for increasetime, checktime and waittime. |
| 117 |
*Nicified source a bit |
| 118 |
|
| 119 |
0.2.1->0.2.2 |
| 120 |
*Locked down memory. Don't know if its necessary. |
| 121 |
|
| 122 |
0.2.0->0.2.1 |
| 123 |
*Cleaned up source a bit. |
| 124 |
*Properly find number of timer processes. |
| 125 |
*Added shortcuts for optargs and beautified the source a bit. |
| 126 |
|
| 127 |
|
| 128 |
0.1.2->0.2.0 |
| 129 |
*Don't do anything if no process priorities are changed, when watchdogging. |
| 130 |
*Added the --force option, that sets the priority of all timer processes to FIFO/99. |
| 131 |
*Added the das_watchdog /etc/init.d script provided by Stefan Kersten. (das_watchdog.rc) |
| 132 |
*Added the --verbose option. |
| 133 |
*Check that its the same process when setting back old priority. |
| 134 |
*Don't set back to old priority if the priority has been changed in the mean time. |
| 135 |
*Added options for setting increasetime, checktime and waittime. |
| 136 |
(--increasetime, --checktime and --waittime) |
| 137 |
*Don't change the priority of any timer process when watchdogging. |
| 138 |
*Smaller code cleanups. |
| 139 |
|
| 140 |
|
| 141 |
0.1.1->0.1.2 |
| 142 |
* Added check for the ksoftrqd/0 process as well as the softirq-timer/0 process. |
| 143 |
* Added check for SCHED_OTHER of the timing process as well as priority. |
| 144 |
* Removed debug-printing. |
| 145 |
|
| 146 |
0.1.0->0.1.1 |
| 147 |
* Added extensive checks both when compiling and when running about the priority of the "softirq-timer/0" |
| 148 |
process: |
| 149 |
- ***If "softirq-timer/0" is not set to a very high priority (99), the watchdog most probably will not work.*** |
| 150 |
- The default priority for softirq-timer/0 seems to be 1. However, for real time work, it must be |
| 151 |
set higher to get reliable timing. Set it to 99. |
| 152 |
- If softirq-timer/0 is set to less than 99, das_watchdog will refuse to compile unless you force it to by |
| 153 |
editing the makefile. When running das_watchdog, it will only give a warning if the priority is set too low. |
| 154 |
* Changed the DISPLAY environment variable to ":0.0" instead of "localhost:0.0". Seems to work for |
| 155 |
everyone now. |
| 156 |
* Switched from libgtop to libgtop2. |
| 157 |
|
| 158 |
0.0.2->0.1.0 |
| 159 |
* Properly setting the DISPLAY and XAUTHORITY environment variables in various ways to make sure |
| 160 |
the message is really shown. (It really works now!) |
| 161 |
|
| 162 |
0.0.1->0.0.2 |
| 163 |
*Use xmessage instead of wish. (much nicer) |
| 164 |
*Run system("xhost +") and setenv("DISPLAY",":0.0",1) before running xmessage. |
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
ACKNOWLEDGEMENT |
| 169 |
--------------- |
| 170 |
The program is mentally based on Florian Schmidts program rt_watcdog. Florian Schmidt |
| 171 |
also wrote the test_rt program. |
| 172 |
|