Re: Spotting Crashed Application

2007-05-16 Thread Tim Golden
Steve Holden wrote:

 Robert Rawlins - Think Blue wrote:

 I’ve got an application that I’ve written, and it sits in an embedded 
 system, from time to time the application will crash, I’m not quite sure 
 what’s causing this, but as we test it more and more we’ll grasp a 
 better understanding and fix the issues.

 However, until then I need a quick solution which can spot the crash and 
 reboot the system. 


 I don't know of any pre-written functionality, but I'd recommend using a 
 UDP socket for this. Let your application send a packet (say) every 30 
 seconds and have the monitoring application restart it if it doesn't 
 hear a packet for 90 seconds.

Strange. I can't see the original message to which Steve's
replying, either on Google Groups or in my mailbox. Still...

I second the UDP heartbeat suggestion. AFAICR there's a
recipe in the printed Cookbook (and presumably the online
one as well). An alternative *might* be to use WMI to watch
for Win32_Process events and then to reboot, but I suspect
WMI might not be available on an embedded system.

TJG
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Spotting Crashed Application

2007-05-16 Thread MRAB
On May 16, 1:55 am, Steve Holden [EMAIL PROTECTED] wrote:
 Robert Rawlins - Think Blue wrote:

  Hello Guys,

  I've got an application that I've written, and it sits in an embedded
  system, from time to time the application will crash, I'm not quite sure
  what's causing this, but as we test it more and more we'll grasp a
  better understanding and fix the issues.

  However, until then I need a quick solution which can spot the crash and
  reboot the system. Is there any generic way of writing a separate
  application that'll spot the crash in my main application? If not then i
  was thinking about having my core application log itself as 'alive'
  every 5 minutes or so. My new 'spotter' application can check this log,
  if it's not been written too in say 6 minutes then the main app must
  have crashed, and it can reboot.

  Any suggestions on how best to handle this? Obviously finding the bug in
  my main app is paramount, but a failsafe will never hurt.

 I don't know of any pre-written functionality, but I'd recommend using a
 UDP socket for this. Let your application send a packet (say) every 30
 seconds and have the monitoring application restart it if it doesn't
 hear a packet for 90 seconds.

An alternative would be for the spotter to start the application using
CreateProcess (this is on MS Windows) and then wait on the handle with
WaitForSingleObject. When the application quits or crashes the wait
will succeed and the spotter can then start the application again.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Spotting Crashed Application

2007-05-15 Thread Steve Holden
Robert Rawlins - Think Blue wrote:
 Hello Guys,
 
  
 
 I’ve got an application that I’ve written, and it sits in an embedded 
 system, from time to time the application will crash, I’m not quite sure 
 what’s causing this, but as we test it more and more we’ll grasp a 
 better understanding and fix the issues.
 
  
 
 However, until then I need a quick solution which can spot the crash and 
 reboot the system. Is there any generic way of writing a separate 
 application that’ll spot the crash in my main application? If not then i 
 was thinking about having my core application log itself as ‘alive’ 
 every 5 minutes or so. My new ‘spotter’ application can check this log, 
 if it’s not been written too in say 6 minutes then the main app must 
 have crashed, and it can reboot.
 
  
 
 Any suggestions on how best to handle this? Obviously finding the bug in 
 my main app is paramount, but a failsafe will never hurt.
 
I don't know of any pre-written functionality, but I'd recommend using a 
  UDP socket for this. Let your application send a packet (say) every 30 
seconds and have the monitoring application restart it if it doesn't 
hear a packet for 90 seconds.

regards
  Steve
-- 
Steve Holden+1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd   http://www.holdenweb.com
Skype: holdenweb  http://del.icio.us/steve.holden
-- Asciimercial -
Get on the web: Blog, lens and tag your way to fame!!
holdenweb.blogspot.comsquidoo.com/pythonology
tagged items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-- Thank You for Reading 

-- 
http://mail.python.org/mailman/listinfo/python-list


Spotting Crashed Application

2007-05-09 Thread Robert Rawlins - Think Blue
Hello Guys,

 

I've got an application that I've written, and it sits in an embedded
system, from time to time the application will crash, I'm not quite sure
what's causing this, but as we test it more and more we'll grasp a better
understanding and fix the issues.

 

However, until then I need a quick solution which can spot the crash and
reboot the system. Is there any generic way of writing a separate
application that'll spot the crash in my main application? If not then i was
thinking about having my core application log itself as 'alive' every 5
minutes or so. My new 'spotter' application can check this log, if it's not
been written too in say 6 minutes then the main app must have crashed, and
it can reboot.

 

Any suggestions on how best to handle this? Obviously finding the bug in my
main app is paramount, but a failsafe will never hurt.

 

Thanks again guys,

 

Rob

-- 
http://mail.python.org/mailman/listinfo/python-list