def detach(path, argv, logfile=None, pidfile=None, uid=None, gid=None, umask=None, workdir=None, fake=False, app=None, executable=None, hostname=None):
 hostname = default_nodename(hostname)
 logfile = node_format(logfile, hostname)
 pidfile = node_format(pidfile, hostname)
 fake = (1 if C_FAKEFORK else fake)
 with detached(logfile, pidfile, uid, gid, umask, workdir, fake, after_forkers=False):
  try:
   if (executable is not None):
    path = executable
   os.execv(path, ([path] + argv))
  except Exception:
   if (app is None):
    from celery import current_app
    app = current_app
   app.log.setup_logging_subsystem(u'ERROR', logfile, hostname=hostname)
   logger.critical(u"Can't exec %r", u' '.join(([path] + argv)), exc_info=True)
  return EX_FAILURE

def detach ( path , argv , logfile = None , pidfile = None , uid = None , gid = None , umask = None , workdir = None , fake = False , app = None , executable = None , hostname = None ) : hostname = default_nodename ( hostname ) logfile = node_format ( logfile , hostname ) pidfile = node_format ( pidfile , hostname ) fake = ( 1 if C_FAKEFORK else fake ) with detached ( logfile , pidfile , uid , gid , umask , workdir , fake , after_forkers = False ) : try : if ( executable is not None ) : path = executable os . execv ( path , ( [ path ] + argv ) ) except Exception : if ( app is None ) : from celery import current_app app = current_app app . log . setup_logging_subsystem ( u'ERROR' , logfile , hostname = hostname ) logger . critical ( u"Can't exec %r" , u' ' . join ( ( [ path ] + argv ) ) , exc_info = True ) return EX_FAILURE
detach program by argv .