def get_process_status_by_pid(self, daemon_pid, storlet_name):
        """
        Check if a process with specific ID runs

        :param daemon_pid:   Storlet daemon process ID
        :param storlet_name: Storlet name we are checking the daemon for
        :returns: (Status, Description text of possible error)
        """
        b_status = False
        error_text = ''
        obtained_pid = 0
        obtained_code = 0
        try:
            obtained_pid, obtained_code = os.waitpid(daemon_pid, os.WNOHANG)
            error_text = 'Storlet {0}, PID = {1}, ErrCode = {2}'. \
                         format(storlet_name, obtained_pid, obtained_code)
            self.logger.debug(error_text)
        except __HOLE__ as err:
            if err.errno == errno.ESRCH:
                error_text = 'No running daemon for {0}'.format(storlet_name)
            elif err.errno == errno.EPERM:
                error_text = 'No permission to access daemon for {0}'. \
                    format(storlet_name)
            else:
                error_text = 'Unknown error'
        else:
            if 0 == obtained_pid and 0 == obtained_code:
                error_text = 'Storlet {0} seems to be OK'.format(storlet_name)
                b_status = True
            else:
                error_text = 'Storlet {0} is terminated'.format(storlet_name)
            self.logger.debug(error_text)
        return b_status, error_text
dataset/ETHPy150Open openstack/storlets/Engine/storlet_daemon_factory/daemon_factory.py/daemon_factory.get_process_status_by_pid