def stopcron():
 global _cron_stopping
 _cron_stopping = True
 while _cron_subprocs:
  proc = _cron_subprocs.pop()
  if (proc.poll() is None):
   try:
    proc.terminate()
   except:
    import traceback
    traceback.print_exc()

def stopcron ( ) : global _cron_stopping _cron_stopping = True while _cron_subprocs : proc = _cron_subprocs . pop ( ) if ( proc . poll ( ) is None ) : try : proc . terminate ( ) except : import traceback traceback . print_exc ( )
graceful shutdown of cron .