def run(self):
        self.log.info('(%s) *** Controller starting at %s' % (self.controller_pid,
                time.asctime()))

        if self.config.get('pidfile'):
            with open(self.config.get('pidfile'), 'w') as fd:
                fd.write('%s\n' % self.controller_pid)

        spawning.setproctitle("spawn: controller " + self.args.get('argv_str', ''))

        if self.sock is None:
            self.sock = bind_socket(self.config)

        signal.signal(signal.SIGHUP, self.handle_sighup)
        signal.signal(signal.SIGUSR1, self.handle_deadlychild)

        if self.config.get('status_port'):
            from spawning.util import status
            eventlet.spawn(status.Server, self,
                self.config['status_host'], self.config['status_port'])

        try:
            self.runloop()
        except __HOLE__:
            self.keep_going = False
            self.kill_children()
        self.log.info('(%s) *** Controller exiting' % (self.controller_pid))
dataset/ETHPy150Open rtyler/Spawning/spawning/spawning_controller.py/Controller.run