User Tools

Site Tools


uphp:functions:clear_watchdog

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:clear_watchdog [2018/08/07 08:50]
jeff
uphp:functions:clear_watchdog [2021/09/13 05:57] (current)
Line 11: Line 11:
 </html></well> </html></well>
  
-Clears the watchdog timer.  This auto-increments in firmware and when it reaches the preset threshold the Wattmon will reboot.  This is implemented to prevent issues if long running scripts block the system.  The interval can be set using [[init_watchdog]]+Clears the watchdog timer.  This auto-increments in firmware once per second and when it reaches the preset threshold the [[hardware:wattmons|Wattmon]] will reboot.  This is implemented to prevent issues if long running scripts block the system.
  
 ====Parameters==== ====Parameters====
Line 25: Line 25:
 <code php> <code php>
 <? <?
-  clear_watchdog(); // reset the counter+  clear_watchdog(); // reset the counter to zero
 ?> ?>
 </code> </code>
Line 31: Line 31:
 ====Additional Information==== ====Additional Information====
  
-Function [[init_watchdog]] can be called to set the value Alternatively the value will be loaded at startup from the watchdog_interval key in the debug section of uphp.ini.+Function [[clear_watchdog]] is called from cronmin.cgi once per minute (WattmonOS 2.26 and above). The default threshold value is 300 seconds (5 minutes), therefore, if cronmin.cgi does not complete at least once during 5 minutes the system will reboot. 
 + 
 +Function [[init_watchdog]] can be called to set the threshold in seconds for when the firmware reboots the system (if function [[clear_watchdog]] has not been called during this time). Alternatively the value set by [[init_watchdog]] can be loaded at startup by adding the watchdog_interval key in the debug section of config/uphp.ini, example for 10 minutes: 
 + 
 +<code> 
 +[debug] 
 +watchdog_interval=600 
 +... 
 +</code> 
 + 
 +This function must be used if you are writing a script that might run longer than 5 minutes, which could possibly keep cronmin.cgi from being able to run, depending on how many scripts can run at the same time. Or it might be needed if the default cronmin.cgi is not used.
  
 ====Also See==== ====Also See====
uphp/functions/clear_watchdog.1533631819.txt.gz · Last modified: 2021/09/13 05:56 (external edit)