Exemplo n.º 1
0
 def _start_arbiter(self, actor, exc=None):
     if current_process().daemon:
         raise HaltServer('Cannot create the arbiter in a daemon process')
     if not os.environ.get('SERVER_SOFTWARE'):
         os.environ["SERVER_SOFTWARE"] = pulsar.SERVER_SOFTWARE
     pid_file = actor.cfg.pid_file
     if pid_file is not None:
         actor.logger.info('Create pid file %s', pid_file)
         try:
             p = Pidfile(pid_file)
             p.create(actor.pid)
         except RuntimeError as e:
             raise HaltServer('ERROR. %s' % str(e), exit_code=2)
         self.pid_file = p
Exemplo n.º 2
0
def start_arbiter(self):
    if current_process().daemon:
        raise pulsar.PulsarException(
            'Cannot create the arbiter in a daemon process')
    os.environ["SERVER_SOFTWARE"] = pulsar.SERVER_SOFTWARE
    pidfile = self.cfg.pidfile
    if pidfile is not None:
        try:
            p = Pidfile(pidfile)
            p.create(self.pid)
        except RuntimeError as e:
            raise HaltServer('ERROR. %s' % str(e), exit_code=3)
        self.pidfile = p
    return self
Exemplo n.º 3
0
 def _exit(self, exit_code):
     raise HaltServer(exit_code=exit_code)
Exemplo n.º 4
0
 def _register(self, arbiter):
     raise HaltServer('Critical error')
Exemplo n.º 5
0
 def done(self, exit_code=None):
     exit_code = exit_code or 0
     if exit_code < 3:
         raise HaltServer(exit_code=exit_code)