restart on a crash? #12

Closed
bosky101 opened this Issue Dec 18, 2013 · 2 comments

3 participants

@bosky101

what is the expected design pattern for implementing restarts on crashing?

from the documentation, it isn't apparent how to handle errors

 from daemon import Daemon
 class App(Daemon):
   def run(self):     
     try:
       foo()
     except:
       print 'crashing, so restart ?'
       daemon_runner.run()

 daemon_runner = App('/tmp/app.pid')
 daemon_runner.run()

or are restarts supposed to be handled by another process/module?

if restarts are indeed handled, an example would be great.

thanks

@medecau

Yep, external process monitoring your daemon.

I'd do this with Supervisor.

@carlosperello

As @medecau already said, that task should be handled externally with something like Supervior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment