etwist/server.py
changeset 6782 b5d6f5391695
parent 6779 accf5978a440
child 6817 1959d97ebf2e
equal deleted inserted replaced
6762:812445504835 6782:b5d6f5391695
   413         if sys.platform == 'win32':
   413         if sys.platform == 'win32':
   414             raise ConfigurationError("Under windows, you must use the service management "
   414             raise ConfigurationError("Under windows, you must use the service management "
   415                                      "commands (e.g : 'net start my_instance)'")
   415                                      "commands (e.g : 'net start my_instance)'")
   416         from logilab.common.daemon import daemonize
   416         from logilab.common.daemon import daemonize
   417         LOGGER.info('instance started in the background on %s', root_resource.base_url)
   417         LOGGER.info('instance started in the background on %s', root_resource.base_url)
   418         if daemonize(config['pid-file']):
   418         whichproc = daemonize(config['pid-file'], umask=config['umask'])
   419             return # child process
   419         if whichproc: # 1 = orig process, 2 = first fork, None = second fork (eg daemon process)
       
   420             return whichproc # parent process
   420     root_resource.init_publisher() # before changing uid
   421     root_resource.init_publisher() # before changing uid
   421     if config['uid'] is not None:
   422     if config['uid'] is not None:
   422         try:
   423         try:
   423             uid = int(config['uid'])
   424             uid = int(config['uid'])
   424         except ValueError:
   425         except ValueError: