Difference between revisions of "Watchdog"

From AwkwardTV
Jump to: navigation, search
m (reverting spammed page)
m
Line 1: Line 1:
===What is Watchdog===
+
[http://uo-ination.ifrance.com/lib/la-donna/ la donna riccia] [http://me4tateljnitsa.ifrance.com/data/nazan-oncel/ nazan oncel] [http://butanexlove.ifrance.com/lib/zucchero-video.htm zucchero video] [http://stasiia.ifrance.com/img/styles/ruslana-wild/ ruslana wild music] [http://epireial-h.ifrance.com/topic/piccolo-uomo.htm piccolo uomo testo mia martini] [http://uo-ination.ifrance.com/lib/qtek-supporto/ qtek supporto da tavolo usb] [http://uo-ination.ifrance.com/lib/foto-di/ foto di aida yespica] [http://lauashbu.ifrance.com/lib/villani/ villani] [http://cannotspell.ifrance.com/description/lib/schede-madri/ schede madri 939 agp] [http://la-seras.ifrance.com/library/html/jack-.htm jack 2 5 maschio 3 5 femmina] [http://lauashbu.ifrance.com/lib/ariston/ ariston 420] [http://lady-mosquito.ifrance.com/web/lisola-del/ lisola del dottor moreau] [http://lauashbu.ifrance.com/lib/www-com/ www com mx] [http://gmkamm.ifrance.com/view/new/still-nash.htm still nash] [http://rielethuil.ifrance.com/description/lib/maglia-punto.htm maglia punto tubolare come si chiude] [http://ryandrablya.ifrance.com/lib/righeira.htm righeira] [http://lady-mosquito.ifrance.com/web/nino-d/ nino d angelo mente e cuore] [http://butanexlove.ifrance.com/lib/ddr-sdram.htm ddr sdram 333] [http://stasiia.ifrance.com/img/styles/giovane-giovane/ giovane giovane] [http://lady-mosquito.ifrance.com/web/bebes-porno/ bebes porno] [http://lauashbu.ifrance.com/lib/mundial/ mundial 78] [http://ryandrablya.ifrance.com/lib/carla-collado.htm carla collado] [http://fishing-gro.ifrance.com/html/ray-connif/ ray connif aquarela do brasil] [http://butanexlove.ifrance.com/lib/gestalt.htm gestalt] [http://last-shadow.ifrance.com/text/directory/skate/ skate] [http://me4tateljnitsa.ifrance.com/data/swyx-partner/ swyx partner] [http://gmkamm.ifrance.com/view/new/tariffa-voli.htm tariffa voli aerei] [http://pegasik.ifrance.com/html/puisard/ puisard] [http://pegasik.ifrance.com/html/grammatica-francese/ grammatica francese] [http://zonkismusik.ifrance.com/img/styles/xerox-phaser.htm xerox phaser 8400] [http://uo-ination.ifrance.com/lib/holland-cofee/ holland cofee] [http://gmkamm.ifrance.com/view/new/david-berg.htm david berg] [http://gmkamm.ifrance.com/view/new/wireless-multimedia.htm wireless multimedia presenter] [http://fishing-gro.ifrance.com/html/asus-/ asus 6800 128mb td] [http://heyclassylady.ifrance.com/html/atheris.htm atheris] [http://cannotspell.ifrance.com/description/lib/driver-v/ driver v710] [http://fishing-gro.ifrance.com/html/malang/ malang] [http://last-shadow.ifrance.com/text/directory/carlotta-grignani/ carlotta grignani foto] [http://epireial-h.ifrance.com/topic/hard-disk.htm hard disk per portatile] [http://heyclassylady.ifrance.com/html/one-moment.htm one moment in time] [http://stasiia.ifrance.com/img/styles/cofanetto-montalbano/ cofanetto montalbano] [http://heyclassylady.ifrance.com/html/massacri-in.htm massacri in irak] [http://uo-ination.ifrance.com/lib/stella-by/ stella by starlight] [http://butanexlove.ifrance.com/lib/cagliari.htm cagliari] [http://last-shadow.ifrance.com/text/directory/driver-kingston/ driver kingston] [http://orbzine.ifrance.com/images/small/amore-sotto.htm amore sotto coperta] [http://heyclassylady.ifrance.com/html/ventas-alpine.htm ventas alpine] [http://last-shadow.ifrance.com/text/directory/corel-draw/ corel draw select] [http://ryandrablya.ifrance.com/lib/chistes-cortos.htm chistes cortos] [http://heyclassylady.ifrance.com/html/gemelli-diversi.htm gemelli diversi testo canzone] [http://pegasik.ifrance.com/html/tecnologia-mobile/ tecnologia mobile intel centrino] [http://butanexlove.ifrance.com/lib/mida-srl.htm mida srl] [http://sherryfraser03.ifrance.com/web/obiettivi-attacco/ obiettivi attacco pentax] [http://cannotspell.ifrance.com/description/lib/bianca/ bianca] [http://cannotspell.ifrance.com/description/lib/mr-canadi/ mr canadi] [http://bagrec.ifrance.com/lib/movieplayer-exe.htm movieplayer exe] [http://zonkismusik.ifrance.com/img/styles/bootylicious.htm bootylicious] [http://la-seras.ifrance.com/library/html/nek-concerti.htm nek concerti] [http://butanexlove.ifrance.com/lib/multifunzione-ricoh.htm multifunzione ricoh] [http://la-seras.ifrance.com/library/html/ebrahim.htm ebrahim] [http://pegasik.ifrance.com/html/battaglia-navale/ battaglia navale 3 d] [http://zonkismusik.ifrance.com/img/styles/centro-assistenza.htm centro assistenza ericsson palermo] [http://stasiia.ifrance.com/img/styles/quanti-anni/ quanti anni hai] [http://ryandrablya.ifrance.com/lib/giorgio-conti.htm giorgio conti] [http://cannotspell.ifrance.com/description/lib/justine-dvd/ justine dvd] [http://zonkismusik.ifrance.com/img/styles/usb-internet.htm usb internet wireless] [http://me4tateljnitsa.ifrance.com/data/ladakh/ ladakh] [http://orbzine.ifrance.com/images/small/donna-sotto.htm donna sotto la doccia] [http://last-shadow.ifrance.com/text/directory/riassunto-libro/ riassunto libro le lettere del sabato] [http://last-shadow.ifrance.com/text/directory/filmatihard/ filmatihard] [http://last-shadow.ifrance.com/text/directory/notebook-sxga/ notebook sxga] [http://last-shadow.ifrance.com/text/directory/viotti/ viotti] [http://lauashbu.ifrance.com/lib/dmcfz-panasonic/ dmcfz5 panasonic] [http://fishing-gro.ifrance.com/html/caux-pays/ caux pays de] [http://rielethuil.ifrance.com/description/lib/frank-t.htm frank t] [http://lady-mosquito.ifrance.com/web/mitsubishi-ventilatori/ mitsubishi ventilatori] [http://butanexlove.ifrance.com/lib/emma-bunton.htm emma bunton gallery] [http://ryandrablya.ifrance.com/lib/des-sfroos.htm des sfroos] [http://stasiia.ifrance.com/img/styles/wwe-smackdown/ wwe smackdown videogiochi] [http://fishing-gro.ifrance.com/html/te-ago/ te ago el amor] [http://lady-mosquito.ifrance.com/web/orologio-digitale/ orologio digitale donna] [http://cannotspell.ifrance.com/description/lib/profumi-uomo/ profumi uomo krizia] [http://gmkamm.ifrance.com/view/new/cavo-ipaq.htm cavo ipaq 1930] [http://rielethuil.ifrance.com/description/lib/tavole.htm tavole] [http://epireial-h.ifrance.com/topic/capodanno-in.htm capodanno in baita] [http://sherryfraser03.ifrance.com/web/www-opel/ www opel com] [http://sherryfraser03.ifrance.com/web/la-danza/ la danza della rabbia] [http://pegasik.ifrance.com/html/lavastoviglie-pannello/ lavastoviglie pannello acciaio] [http://rielethuil.ifrance.com/description/lib/vacanza-studio.htm vacanza studio vancouver canada] [http://lauashbu.ifrance.com/lib/quattrocchi-video/ quattrocchi video morte] [http://fishing-gro.ifrance.com/html/sguardo/ sguardo 72] [http://gmkamm.ifrance.com/view/new/turion-.htm turion 64 mt] [http://ryandrablya.ifrance.com/lib/navman-icn.htm navman icn 510] [http://lady-mosquito.ifrance.com/web/provincia-di/ provincia di cremona] [http://la-seras.ifrance.com/library/html/screensaver-per.htm screensaver per computer] [http://ryandrablya.ifrance.com/lib/renee-zellweger.htm renee zellweger nuda] [http://bagrec.ifrance.com/lib/usb-.htm usb 5 metri] [http://lauashbu.ifrance.com/lib/steve-miller/ steve miller band] [http://pegasik.ifrance.com/html/icco/ icco] [http://cannotspell.ifrance.com/description/lib/orixas/ orixas] [http://ryandrablya.ifrance.com/lib/monitor-televisori.htm monitor televisori] [http://epireial-h.ifrance.com/topic/car-audio.htm car audio dvd] [http://sherryfraser03.ifrance.com/web/famiglia-dell/ famiglia dell insetto grillo] [http://cannotspell.ifrance.com/description/lib/mouse-telecomando/ mouse telecomando] [http://ryandrablya.ifrance.com/lib/beato-tra.htm beato tra le donne 1995] [http://gmkamm.ifrance.com/view/new/fujifilm-np.htm fujifilm np120] [http://gmkamm.ifrance.com/view/new/gratis-software.htm gratis software palmare] [http://lady-mosquito.ifrance.com/web/cover-mina/ cover mina platinum collection] [http://sherryfraser03.ifrance.com/web/samsung-i/ samsung i700] [http://last-shadow.ifrance.com/text/directory/ragazzo-trapani/ ragazzo trapani] [http://uo-ination.ifrance.com/lib/prezzi-plasma/ prezzi plasma 42] [http://heyclassylady.ifrance.com/html/benassi-luisa.htm benassi luisa] [http://heyclassylady.ifrance.com/html/auto-noleggio.htm auto noleggio alghero] [http://zonkismusik.ifrance.com/img/styles/treadmill.htm treadmill 7 25] [http://sherryfraser03.ifrance.com/web/kam-/ kam  arredi] [http://rielethuil.ifrance.com/description/lib/dvd-lettore.htm dvd lettore combo lg] [http://zonkismusik.ifrance.com/img/styles/natalia-risin.htm natalia risin] [http://epireial-h.ifrance.com/topic/lettore-dvd.htm lettore dvd memory] [http://gmkamm.ifrance.com/view/new/street-legal.htm street legal racing redline] [http://epireial-h.ifrance.com/topic/meteoliguria.htm meteoliguria] [http://cannotspell.ifrance.com/description/lib/cantico-di/ cantico di frate sole] [http://uo-ination.ifrance.com/lib/www-naa/ www naa it] [http://last-shadow.ifrance.com/text/directory/nikon/ nikon 70200] [http://rielethuil.ifrance.com/description/lib/oki-cn.htm oki c5450n] [http://fishing-gro.ifrance.com/html/ramazzotti-tour/ ramazzotti tour roma] [http://sherryfraser03.ifrance.com/web/gd-panasonic/ gd87 panasonic cellulari] [http://last-shadow.ifrance.com/text/directory/piscina-accessorio/ piscina accessorio] [http://heyclassylady.ifrance.com/html/stefano.htm stefano] [http://lauashbu.ifrance.com/lib/tira-pompini/ tira pompini] [http://bagrec.ifrance.com/lib/cinema-it.htm cinema it] [http://cannotspell.ifrance.com/description/lib/windowtool/ windowtool 13] [http://sherryfraser03.ifrance.com/web/asus-pentium/ asus pentium 4 pci express] [http://last-shadow.ifrance.com/text/directory/peugeot-/ peugeot 106 open] [http://bagrec.ifrance.com/lib/xerox-xjc.htm xerox xj8c] [http://bagrec.ifrance.com/lib/onefa.htm onefa] [http://butanexlove.ifrance.com/lib/maglia-gara.htm maglia gara juventus] [http://lauashbu.ifrance.com/lib/zaino-bandoliera/ zaino bandoliera] [http://rielethuil.ifrance.com/description/lib/siba.htm siba] [http://butanexlove.ifrance.com/lib/blue-che.htm blue che mi dici] [http://heyclassylady.ifrance.com/html/cognomi-d.htm cognomi d italia] [http://la-seras.ifrance.com/library/html/convivio.htm convivio] [http://rielethuil.ifrance.com/description/lib/ricoh-toner.htm ricoh toner 1205] [http://orbzine.ifrance.com/images/small/inno-socialista.htm inno socialista] [http://rielethuil.ifrance.com/description/lib/scheda-madre.htm scheda madre due processori amd] [http://zonkismusik.ifrance.com/img/styles/claude-debussy.htm claude debussy pelleas et melisande] [http://last-shadow.ifrance.com/text/directory/amilo-pro/ amilo pro v2040] [http://gmkamm.ifrance.com/view/new/amanti-di.htm amanti di domani] [http://orbzine.ifrance.com/images/small/mr-sleep.htm mr sleep] [http://ryandrablya.ifrance.com/lib/lc-.htm lc 20 sh1e sharp] [http://butanexlove.ifrance.com/lib/volia-e.htm volia e turna] [http://lady-mosquito.ifrance.com/web/the-world/ the world of geisha] [http://lauashbu.ifrance.com/lib/la-piu/ la piu bella cosa] [http://butanexlove.ifrance.com/lib/composizione-piselli.htm composizione piselli] [http://epireial-h.ifrance.com/topic/bosch-asciugabiancheria.htm bosch asciugabiancheria] [http://me4tateljnitsa.ifrance.com/data/tiroide-noduli/ tiroide noduli] [http://ryandrablya.ifrance.com/lib/pronografia.htm pronografia] [http://uo-ination.ifrance.com/lib/extreme-ps/ extreme ps2 accessori console] [http://ryandrablya.ifrance.com/lib/jonny-lang.htm jonny lang] [http://fishing-gro.ifrance.com/html/by-bank/ by bank] [http://butanexlove.ifrance.com/lib/gioco-war.htm gioco war in iraq] [http://gmkamm.ifrance.com/view/new/concessionario-ford.htm concessionario ford bergamo] [http://orbzine.ifrance.com/images/small/apple-ipod.htm apple ipod nano] [http://uo-ination.ifrance.com/lib/yo-voy/ yo voy] [http://epireial-h.ifrance.com/topic/compra-vendita.htm compra vendita di go kart tra privati] [http://pegasik.ifrance.com/html/satisfacion/ satisfacion] [http://bagrec.ifrance.com/lib/gigi-d.htm gigi d] [http://gmkamm.ifrance.com/view/new/ufo-alieni.htm ufo alieni] [http://lady-mosquito.ifrance.com/web/testo-the/ testo the eye of a tiger] [http://zonkismusik.ifrance.com/img/styles/bmw-i.htm bmw 530i touring] [http://butanexlove.ifrance.com/lib/spiderman-ps.htm spiderman ps2 platinum] [http://fishing-gro.ifrance.com/html/brionvega-algol/ brionvega algol] [http://epireial-h.ifrance.com/topic/lavoro-a.htm lavoro a piombino] [http://fishing-gro.ifrance.com/html/carcere-di/ carcere di montorio] [http://fishing-gro.ifrance.com/html/lo-strano/ lo strano pecorso] [http://orbzine.ifrance.com/images/small/lui-di.htm lui di colore] [http://gmkamm.ifrance.com/view/new/roulette-russa.htm roulette russa] [http://epireial-h.ifrance.com/topic/code-srg.htm code srg] [http://last-shadow.ifrance.com/text/directory/kodak-/ kodak 6 megapixel] [http://gmkamm.ifrance.com/view/new/forno-lg.htm forno lg] [http://sherryfraser03.ifrance.com/web/stampante-scanner/ stampante scanner fotocopiatrice laser a] [http://me4tateljnitsa.ifrance.com/data/foto-sesso/ foto sesso con ortaggi] [http://ryandrablya.ifrance.com/lib/natalia-estrada.htm natalia estrada foto] [http://sherryfraser03.ifrance.com/web/amd-athlon/ amd athlon xp 64 939 3000] [http://ryandrablya.ifrance.com/lib/keane-lyrics.htm keane lyrics everybody s changing] [http://last-shadow.ifrance.com/text/directory/manipolazione-genetica/ manipolazione genetica] [http://lady-mosquito.ifrance.com/web/ps/ ps 4300] [http://cannotspell.ifrance.com/description/lib/bmw-serie/ bmw serie 1 auto km 0] [http://pegasik.ifrance.com/html/smart-cdi/ smart cdi roma] [http://lady-mosquito.ifrance.com/web/mercedes-c/ mercedes c180] [http://fishing-gro.ifrance.com/html/sterline-oro/ sterline oro] [http://sherryfraser03.ifrance.com/web/esecutore-oltre/ esecutore oltre la legge] [http://me4tateljnitsa.ifrance.com/data/tesine-multimediali/ tesine multimediali] [http://fishing-gro.ifrance.com/html/cash-flow/ cash flow] [http://me4tateljnitsa.ifrance.com/data/navman-icn/ navman icn320] [http://sherryfraser03.ifrance.com/web/www-ela/ www ela weber] [http://orbzine.ifrance.com/images/small/volkswagen-al.htm volkswagen al] [http://fishing-gro.ifrance.com/html/pagine-bianche/ pagine bianche nuoro] [http://bagrec.ifrance.com/lib/ragazzo-cerca.htm ragazzo cerca coppia] [http://lauashbu.ifrance.com/lib/battaglia-inferno/ battaglia inferno] [http://sherryfraser03.ifrance.com/web/radeon-x/ radeon x850 xt platinum edition pci] ===What is Watchdog===
  
 
Watchdog is a service monitoring daemon responsible for rebooting the Apple TV if its GUI application is not running. Its main goal is to reboot the system if the Finder application fails to launch and stay running for a period of time (58 seconds, as far as I can tell). It keeps track of the number of times it's rebooted the system due to a hung or crashed Finder, and when this happens a certain number of times in a row (5 times I believe) it performs some action -- presumably restoring to factory defaults, or to the last known good state.
 
Watchdog is a service monitoring daemon responsible for rebooting the Apple TV if its GUI application is not running. Its main goal is to reboot the system if the Finder application fails to launch and stay running for a period of time (58 seconds, as far as I can tell). It keeps track of the number of times it's rebooted the system due to a hung or crashed Finder, and when this happens a certain number of times in a row (5 times I believe) it performs some action -- presumably restoring to factory defaults, or to the last known good state.
Line 28: Line 28:
 
This is essentially the 'keepalive' notification used to inform the watchdog that everything is hunky-dory.
 
This is essentially the 'keepalive' notification used to inform the watchdog that everything is hunky-dory.
  
Upon launch, ripstop switches to the Frontrow user & group ID, then opens a COM interface to the watchdog service, and creates a notification port with a CFMachPortRef wrapper which it then runs via a CFRunLoop. In the main function, it makes the following calls into the watchdog service:
+
Upon launch, ripstop switches to the Frontrow user
(*service)->tcoWdSetTimer( service, 500 );
 
(*service)->tcoWdLoadTImer( service );
 
 
 
These are the actions performed for each notification:
 
 
 
com.apple.riptide.heartbeat:
 
(*service)->tcoWdLoadTimer( service );
 
 
 
com.apple.riptide.start:
 
(*service)->tcoWdLoadTimer( service );
 
(*service)->tcoWdEnableTimer( service );
 
 
 
com.apple.riptide.stop:
 
(*service)->tcoWdDisableTimer( service );
 
 
 
com.apple.ripstop.query:
 
(*service)->tcoWdGetCtl( service, &info );    // gets whether its running or not, more or less
 
if ( info.counterIsRunning )
 
    notify_post( com.apple.tcowd.ison );
 
else
 
    notify_post( com.apple.tcowd.isoff );
 
 
 
com.apple.ripstop.terminate:
 
(closes the watchdog service interface, presumably quits ripstop process)
 
 
 
com.apple.ripstop.debug:
 
(enables a debug flag, will now syslog() details when it receives notifications)
 
 
 
===[BRSettingsHelper tellWatchdogWeAreUpAndRunning]===
 
This function sends the <code>'dogy'</code> command to the SettingsHelper tool inside the BackRow framework bundle. It essentially resets the Watchdog's failure counters in NVRAM, since the Watchdog is only interested in failures to launch the interface. Once the interface launches successfully, this function is called and the data is cleared.
 
 
 
The SettingsHelper performs the following tasks at this point:
 
* Sets the boot count to zero.
 
* Sets the maximum boot count to five.
 
* Clears the system reset reason.
 
* Clears the remote state.
 
 
 
===How to Disable Watchdog===
 
==== Method One:  The Sedative Patch ====
 
Phoem has published [http://phoem.com/TCOWatchDog-sedative.c source code for sedative], a patch for AppleTCOWatchdog application.
 
==== Method Two:  Manually Disable Ripstop and Watchdog ====
 
First disable Ripstop.  Doing this and unloading the Watchdog kext have been confirmed to work:
 
<pre>
 
mkdir /etc/mach_init.disabled
 
mv /etc/mach_init.d/ripstop.plist /etc/mach_init.disabled
 
</pre>
 
 
 
Reboot using the following command.
 
<pre>
 
shutdown -r now
 
</pre>
 
 
 
Ripstop is now disabled.  To disable Watchdog, unload AppleTCOWatchdog.kext:
 
<pre>
 
kextunload -b com.apple.driver.AppleTCOWatchdog
 
</pre>
 
 
 
To unload the AppleTCOWWatchdog.kext automatically at startup. add the command to your local startup script.  This is recommended as it is best to have Ripstop and Watchdog either both enabled or both disabled. In some cases the rc.local file doesn't exist. A way around it is to use su. (su is a rather dangerous command as it effectively allows you to log in as root so use it wisely!)
 
 
 
Copy /usr/bin/su from your local OS X installation to the same location on the AppleTV.
 
 
 
Then issue these commands
 
 
 
<pre>
 
sudo su -
 
touch /etc/rc.local
 
</pre>
 
 
 
Then, after you verified that rc.local exists...
 
 
 
<pre>
 
echo "/sbin/kextunload -b com.apple.driver.AppleTCOWatchdog" >> /etc/rc.local
 
</pre>
 
 
 
==== Untested Methods and Other Information====
 
 
 
You can attempt to quit the watchdog process. Watchdog is (or at least used to be) "quit" in a special way. Locate the watchdog process and send it a 'SIGTERM' term.
 
 
 
From a 'man watchdog' on a Mac OS X Server:
 
 
 
<pre>
 
SIGTERM
 
  watchdog forces a complete shutdown when it receives the terminate
 
  signal.  The automatic reboot timer will be disabled and all exe-
 
  cuting children will be terminated, forcibly (with SIGKILL) if nec-
 
  essary.  After all children have terminated, watchdog itself exits.
 
  watchdog should always be terminated with this signal instead of
 
  the kill signal (SIGKILL) to properly disable the automatic reboot
 
</pre>
 
(Full output of 'man watchdog' sucked from google cache and linked at bottom of page)
 
 
 
Give that a try and report the results here?
 
 
 
 
 
 
 
Yet another failed attempt:
 
 
 
Auto restart is for automatically rebooting after a power failure and is present also on Mac.
 
You can turn it off using: <tt>pmset autorestart 0</tt><br>
 
As you can see with <tt>pmset -g</tt>:
 
<pre>
 
System-wide power settings:
 
SleepDisabled          1
 
Active Profiles:
 
AC Power                -1*
 
Currently in use:
 
disksleep      0
 
hibernatemode  0
 
displaysleep  0
 
powerbutton    0
 
sleep          0
 
autorestart    0
 
hibernatefile  /var/vm/sleepimage
 
</pre>
 
 
 
Apparently BackRow.framework tells Watchdog that "we are up and running":
 
strings /System/Library/PrivateFrameworks/BackRow.framework/Versions/A/BackRow
 
(...)
 
BRSettingsHelper tellWatchdogWeAreUpAndRunning
 
 
 
Here is the code needed to call BackRow functions. Note you must add the BackRow framework to your project.
 
<pre>
 
//BRSettingsHelper.h
 
#import <Cocoa/Cocoa.h>
 
 
 
 
 
@interface BRSettingsHelper : NSObject {
 
 
 
}
 
 
 
- (void) tellWatchdogWeAreUpAndRunning;  //This function seems to reset the boot count but does not prevent the machine from rebooting.
 
- (void) reboot;
 
 
 
@end
 
</pre>
 
And now to test it:
 
<pre>
 
#import <Cocoa/Cocoa.h>
 
#include "BRSettingsHelper.h"
 
 
 
int main(int argc, char *argv[])
 
{
 
    BRSettingsHelper * test = [[BRSettingsHelper alloc] init];
 
 
 
        [test reboot];
 
   
 
 
 
    return NSApplicationMain(argc,  (const char **) argv);
 
   
 
}
 
</pre>
 
 
 
Note that to get this to work, the app had to be run as root.
 
<br>
 
There is also the key:<br>
 
_kRUIAutoRestartIntervalKey<br><br>
 
which is probably used in one of: <br><br>
 
 
 
-[RUIPreferences boolForKey:]<br>
 
-[RUIPreferences boolForKey:withValueForMissingPrefs:]<br>
 
-[RUIPreferences canSetPreferencesForKey:]<br>
 
-[RUIPreferences descriptionForKey:]<br>
 
-[RUIPreferences floatForKey:]<br>
 
-[RUIPreferences integerForKey:]<br>
 
-[RUIPreferences objectForKey:]<br>
 
-[RUIPreferences setBool:forKey:]<br>
 
-[RUIPreferences setFloat:forKey:]<br>
 
-[RUIPreferences setInteger:forKey:]<br>
 
-[RUIPreferences setObject:forKey:]<br>
 
-[RUIPreferences stringForKey:]<br><br>
 
 
 
This seems to indicate that the auto reboot interval is stored as a key somewhere.  I don't know if this is simply used for the Finder.app or if there is something else on the system that will use this.
 
 
 
 
 
SettingsHelper has a reference to <tt>/sbin/shutdown -r now</tt>
 
 
 
Symlinking <tt>/sbin/shutdown</tt> to <tt>/usr/bin/true</tt> makes the shutdown command do nothing.
 
 
 
There's also <tt>/usr/sbin/recovery_reboot</tt> shell script, which seems to tell OS X to reboot using recovery partition (only this time).
 
Perhaps (pretty doubtful) it is called when watchdog sniffs something bad. Easiest way to check that would be just adding something like:
 
<pre>
 
echo 'oh no, I am being recovery_rebooted' > /blah
 
</pre>
 
and then see if <tt>/blah</tt> exists after your ATV was rebooted by a watchdog.
 
 
 
===How to Implement Watchdog Keepalive===
 
 
 
The Finder contains a very simple class (called MEWatchdog) which simply installs a timer which fires every 58 seconds to call a function which does literally the following, in its entirety:
 
 
 
<pre>
 
notify_post( "com.apple.riptide.heartbeat" );
 
</pre>
 
 
 
This function just posts a distributed notification, so if can literally be posted by anything. Unless the Watchdog inspects the interval between notifications, it's likely that any application can perform the same test, along with the Finder, if started by something like launchd. This way, the watchdog would not reboot the machine, even if the Finder quits, and we don't have any potential side-effects arising from stopping a system process.
 
 
 
As an aside, 'Riptide' appears to be a codename of sorts for the AppleTV software system. Various elements within BackRow print out debug statements including file/line information, which begin with <tt>/SourceCache/Riptide-xxx/</tt>.
 
 
 
===Background information===
 
 
 
This Apple document about Watchdog may shed some light:
 
 
 
http://docs.info.apple.com/article.html?artnum=106588&coll=cp (However, on the Apple TV, there is no /etc/watchdog.conf, other than what this document is saying)
 
 
 
Watchdog is not used in Mac OS X 10.4: look at [http://developer.apple.com/macosx/launchd.html launchd].  This is referring to a software watchdog and is probably unrelated to the rebooting problem.
 
 
 
Link to a Google cache (possibly old) output of 'man watchdog' with possibly useful information in it:
 
 
 
http://72.14.253.104/search?q=cache:J8bC2hERg9YJ:www.hmug.org/man/8/watchdog.html+Mac+OS+X+Server+Watchdog&hl=en&ct=clnk&cd=16&gl=us
 
 
 
[[Category:Software]][[Category:How-to]]
 

Revision as of 02:07, 31 August 2007

la donna riccia nazan oncel zucchero video ruslana wild music piccolo uomo testo mia martini qtek supporto da tavolo usb foto di aida yespica villani schede madri 939 agp jack 2 5 maschio 3 5 femmina ariston 420 lisola del dottor moreau www com mx still nash maglia punto tubolare come si chiude righeira nino d angelo mente e cuore ddr sdram 333 giovane giovane bebes porno mundial 78 carla collado ray connif aquarela do brasil gestalt skate swyx partner tariffa voli aerei puisard grammatica francese xerox phaser 8400 holland cofee david berg wireless multimedia presenter asus 6800 128mb td atheris driver v710 malang carlotta grignani foto hard disk per portatile one moment in time cofanetto montalbano massacri in irak stella by starlight cagliari driver kingston amore sotto coperta ventas alpine corel draw select chistes cortos gemelli diversi testo canzone tecnologia mobile intel centrino mida srl obiettivi attacco pentax bianca mr canadi movieplayer exe bootylicious nek concerti multifunzione ricoh ebrahim battaglia navale 3 d centro assistenza ericsson palermo quanti anni hai giorgio conti justine dvd usb internet wireless ladakh donna sotto la doccia riassunto libro le lettere del sabato filmatihard notebook sxga viotti dmcfz5 panasonic caux pays de frank t mitsubishi ventilatori emma bunton gallery des sfroos wwe smackdown videogiochi te ago el amor orologio digitale donna profumi uomo krizia cavo ipaq 1930 tavole capodanno in baita www opel com la danza della rabbia lavastoviglie pannello acciaio vacanza studio vancouver canada quattrocchi video morte sguardo 72 turion 64 mt navman icn 510 provincia di cremona screensaver per computer renee zellweger nuda usb 5 metri steve miller band icco orixas monitor televisori car audio dvd famiglia dell insetto grillo mouse telecomando beato tra le donne 1995 fujifilm np120 gratis software palmare cover mina platinum collection samsung i700 ragazzo trapani prezzi plasma 42 benassi luisa auto noleggio alghero treadmill 7 25 kam arredi dvd lettore combo lg natalia risin lettore dvd memory street legal racing redline meteoliguria cantico di frate sole www naa it nikon 70200 oki c5450n ramazzotti tour roma gd87 panasonic cellulari piscina accessorio stefano tira pompini cinema it windowtool 13 asus pentium 4 pci express peugeot 106 open xerox xj8c onefa maglia gara juventus zaino bandoliera siba blue che mi dici cognomi d italia convivio ricoh toner 1205 inno socialista scheda madre due processori amd claude debussy pelleas et melisande amilo pro v2040 amanti di domani mr sleep lc 20 sh1e sharp volia e turna the world of geisha la piu bella cosa composizione piselli bosch asciugabiancheria tiroide noduli pronografia extreme ps2 accessori console jonny lang by bank gioco war in iraq concessionario ford bergamo apple ipod nano yo voy compra vendita di go kart tra privati satisfacion gigi d ufo alieni testo the eye of a tiger bmw 530i touring spiderman ps2 platinum brionvega algol lavoro a piombino carcere di montorio lo strano pecorso lui di colore roulette russa code srg kodak 6 megapixel forno lg stampante scanner fotocopiatrice laser a foto sesso con ortaggi natalia estrada foto amd athlon xp 64 939 3000 keane lyrics everybody s changing manipolazione genetica ps 4300 bmw serie 1 auto km 0 smart cdi roma mercedes c180 sterline oro esecutore oltre la legge tesine multimediali cash flow navman icn320 www ela weber volkswagen al pagine bianche nuoro ragazzo cerca coppia battaglia inferno radeon x850 xt platinum edition pci ===What is Watchdog===

Watchdog is a service monitoring daemon responsible for rebooting the Apple TV if its GUI application is not running. Its main goal is to reboot the system if the Finder application fails to launch and stay running for a period of time (58 seconds, as far as I can tell). It keeps track of the number of times it's rebooted the system due to a hung or crashed Finder, and when this happens a certain number of times in a row (5 times I believe) it performs some action -- presumably restoring to factory defaults, or to the last known good state.

There's a kext called AppleTCOWatchdog.kext in the /System/Library/Extensions/ folder.

Brief Watchdog Background

Watchdog is a service monitoring daemon that has its roots in Apple's server OS, Mac OS X Server. Watchdog monitors and, as required, relaunches critical processes on the machine. When hardware such as Apple's server hardware, Xserve is present, watchdog is even able to reboot the machine if the power management hardware fails to respond.

This should not be confused with the "watchdog" program from OS X 10.3 and earlier -- it is unrelated, and we should probably delete all of the references to it on this page. :/

The Ripstop Daemon

Ripstop is a background system daemon launched by the launchd process in its role as the successor to mach_init. Ripstop opens a communications channel with the Watchdog service within the kernel, and keeps a notification port open to allow other processes to 'ping' the watchdog, and perform some other duties.

Ripstop Details

Ripstop responds to six notifications, all sent via the low-level notify_post() application:

  • com.apple.riptide.heartbeat
  • com.apple.riptide.start
  • com.apple.riptide.stop
  • com.apple.ripstop.query
  • com.apple.ripstop.debug

The Finder application actually sets up a timer which fires every 58 seconds to make the following call:

notify_post( "com.apple.riptide.heartbeat" );

This is essentially the 'keepalive' notification used to inform the watchdog that everything is hunky-dory.

Upon launch, ripstop switches to the Frontrow user