def _StartBabysitter(servers):
 import daemon
 from viewfinder.backend.prod import babysitter
 os.mkdir('logs')
 context = daemon.DaemonContext(working_directory=os.getcwd(), stdout=open(os.path.join(os.getcwd(), 'logs', 'STDOUT'), 'w+'), stderr=open(os.path.join(os.getcwd(), 'logs', 'STDERR'), 'w+'), umask=2)
 context.signal_map = {signal.SIGTERM: 'terminate', signal.SIGHUP: 'terminate'}
 with context:
  babysitter.Start(servers)

def _StartBabysitter ( servers ) : import daemon from viewfinder . backend . prod import babysitter os . mkdir ( 'logs' ) context = daemon . DaemonContext ( working_directory = os . getcwd ( ) , stdout = open ( os . path . join ( os . getcwd ( ) , 'logs' , 'STDOUT' ) , 'w+' ) , stderr = open ( os . path . join ( os . getcwd ( ) , 'logs' , 'STDERR' ) , 'w+' ) , umask = 2 ) context . signal_map = { signal . SIGTERM : 'terminate' , signal . SIGHUP : 'terminate' } with context : babysitter . Start ( servers )
runs the babysitter as a daemon process .