예제 #1
0
파일: arbiter.py 프로젝트: lemonad/gunicorn
 def start(self):
     """\
     Initialize the arbiter. Start listening and set pidfile if needed.
     """
     self.pid = os.getpid()
     self.init_signals()
     self.LISTENER = create_socket(self.conf)
     self.pidfile = self.opts.get("pidfile")
     self.log.info("Arbiter booted")
     self.log.info("Listening at: %s" % self.LISTENER)
예제 #2
0
파일: arbiter.py 프로젝트: timf/gunicorn
 def start(self):
     """\
     Initialize the arbiter. Start listening and set pidfile if needed.
     """
     self.pid = os.getpid()
     self.init_signals()
     self.LISTENER = create_socket(self.cfg)
     
     if self.cfg.pidfile is not None:
         self.pidfile = Pidfile(self.cfg.pidfile)
         self.pidfile.create(self.pid)
     self.log.info("Arbiter booted")
     self.log.info("Listening at: %s" % self.LISTENER)
     self.cfg.when_ready(self)
예제 #3
0
    def start(self):
        """\
        Initialize the arbiter. Start listening and set pidfile if needed.
        """
        self.log.info("Starting gunicorn %s", __version__)
        self.pid = os.getpid()
        if self.cfg.pidfile is not None:
            self.pidfile = Pidfile(self.cfg.pidfile)
            self.pidfile.create(self.pid)
        self.cfg.on_starting(self)
        self.init_signals()
        if not self.LISTENER:
            self.LISTENER = create_socket(self.cfg, self.log)

        self.log.debug("Arbiter booted")
        self.log.info("Listening at: %s (%s)", self.LISTENER, self.pid)
        self.log.info("Using worker: %s",
                      self.cfg.settings['worker_class'].get())

        self.cfg.when_ready(self)
예제 #4
0
파일: arbiter.py 프로젝트: acdha/gunicorn
    def start(self):
        """\
        Initialize the arbiter. Start listening and set pidfile if needed.
        """
        self.log.info("Starting gunicorn %s", __version__)
        self.pid = os.getpid()
        if self.cfg.pidfile is not None:
            self.pidfile = Pidfile(self.cfg.pidfile)
            self.pidfile.create(self.pid)
        self.cfg.on_starting(self)
        self.init_signals()
        if not self.LISTENER:
            self.LISTENER = create_socket(self.cfg, self.log)

        self.log.debug("Arbiter booted")
        self.log.info("Listening at: %s (%s)", self.LISTENER,
            self.pid)
        self.log.info("Using worker: %s",
                self.cfg.settings['worker_class'].get())

        self.cfg.when_ready(self)
예제 #5
0
파일: arbiter.py 프로젝트: acdha/gunicorn
    def reload(self):
        old_address = self.cfg.address

        # reload conf
        self.app.reload()
        self.setup(self.app)

        # reopen log files
        self.log.reopen_files()

        # do we need to change listener ?
        if old_address != self.cfg.address:
            self.LISTENER.close()
            self.LISTENER = create_socket(self.cfg, self.log)
            self.log.info("Listening at: %s", self.LISTENER)

        # do some actions on reload
        self.cfg.on_reload(self)

        # unlink pidfile
        if self.pidfile is not None:
            self.pidfile.unlink()

        # create new pidfile
        if self.cfg.pidfile is not None:
            self.pidfile = Pidfile(self.cfg.pidfile)
            self.pidfile.create(self.pid)

        # set new proc_name
        util._setproctitle("master [%s]" % self.proc_name)

        # spawn new workers
        for i in range(self.cfg.workers):
            self.spawn_worker()

        # manage workers
        self.manage_workers()
예제 #6
0
    def reload(self):
        old_address = self.cfg.address

        # reload conf
        self.app.reload()
        self.setup(self.app)

        # reopen log files
        self.log.reopen_files()

        # do we need to change listener ?
        if old_address != self.cfg.address:
            self.LISTENER.close()
            self.LISTENER = create_socket(self.cfg, self.log)
            self.log.info("Listening at: %s", self.LISTENER)

        # do some actions on reload
        self.cfg.on_reload(self)

        # unlink pidfile
        if self.pidfile is not None:
            self.pidfile.unlink()

        # create new pidfile
        if self.cfg.pidfile is not None:
            self.pidfile = Pidfile(self.cfg.pidfile)
            self.pidfile.create(self.pid)

        # set new proc_name
        util._setproctitle("master [%s]" % self.proc_name)

        # spawn new workers
        for i in range(self.cfg.workers):
            self.spawn_worker()

        # manage workers
        self.manage_workers()