def load_subproc_pidfile(self, process_groups):
        if not self.subprocpidfile: return
        resumed_processes = {}
        try:
            f = open(self.subprocpidfile, 'r')
            for line in f:
                process_name, pid, laststart = line.split()
                pid = int(pid)
                laststart = int(laststart)
                try:
                    os.kill(pid, 0)
                except:
                    self.logger.info(
                        "pid doesn't exist, can't resume '%s' with pid %d" %
                        (process_name, pid))
                else:
                    self.logger.info(
                        "would resume process '%s' with pid %d later" %
                        (process_name, pid))
                    resumed_processes[process_name] = (pid, laststart)
            f.close()
        except (IOError, __HOLE__, ValueError) as e:
            self.logger.warn('could not load sub-process pidfile %s' %
                             self.subprocpidfile)
            print type(e)
        else:
            self.logger.info('supervisord load sub-process pidfile')

        for group in process_groups.itervalues():
            for process in group.processes.itervalues():
                process_name = process.config.name
                if process_name in resumed_processes:
                    process.pid, process.laststart = resumed_processes[process_name]
                    process.resumed = True
                    process.change_state(ProcessStates.RUNNING)
                    self.add_process(process)

                    del resumed_processes[process_name]
                    self.resumed_pids.add(process.pid)

                    self.logger.info(
                        "success: resumed process '%s' with pid %d" %
                        (process_name, process.pid))
dataset/ETHPy150Open XiaoMi/minos/supervisor/supervisor/options.py/ServerOptions.load_subproc_pidfile