title: why daemon process terminate
body: <p>I use <a href="https://www.python.org/dev/peps/pep-3143/" rel="nofollow">python-daemon</a> for my home project. But I not understand why daemon teminated after 1 day working.</p>
  
  <p>this my code:</p>
  
  <pre><code>import requests
  import time
  import subprocess
  import os
  import lockfile
  import daemon
  import logging
  import signal
  import sys
  
  Class MyDaemon():
  
  def run(self):
          while True:
              try:
                  self.check_updates()
                  time.sleep(5)
              except ConnectionError as e:
                  self.log.error('Connerction Error')
                  time.sleep(120)
              except (OSError, IOError) as e:
                  self.log.error('I/O Error')
                  time.sleep(120)
              except Exception as e:
                  self.log.error('Exception: '.format(e.__class__))
                  time.sleep(120)
  
  if __name__ == "__main__":
      bot = MyDaemon()
      context = daemon.DaemonContext(
          working_directory=bot.path,
          umask=0o002,
          pidfile=lockfile.FileLock('/tmp/mydaemon.pid'),
  
      )
      # exit()
      if context.pidfile.is_locked():
          exit('daemon is running now!')
  
      #context.signal_map = {signal.SIGHUP: 'terminate',
      #                      signal.SIGUSR1: bot.reload_bot(),
      #                      signal.SIGTERM: bot.exit_bot(),
      #                      }
  
      context.files_preserve = [bot.fh.stream]  # logging
  
      with context:
          bot.run()
  </code></pre>
  
  <p>This privat bot for telegram. In function check_updates(self) send request and treats response for server It's func normali workink in shell(tmux on server). In function run() I catch all exceptions (at least i think so :) ) but this path not workin where i wrong? </p>
  
  <p>Thank's</p>