def spawn_subprocess(self, pargs):
        """
        Launch a JVM process for some storlet daemon

        :param pargs: Arguments for the JVM
        :returns: (Status, Description text of possible error)
        """
        b_status = True
        error_text = ''
        try:
            self.logger.debug('START_DAEMON: actual invocation')
            self.logger.debug('The arguments are: {0}'.format(str(pargs)))
            # TODO(takashi): We had better use contextmanager
            # TODO(takashi): Where is this closed?
            # TODO(takashi): Should we really use this?
            dn = open('/dev/null', 'w')
            daemon_p = subprocess.Popen(pargs,
                                        stdout=dn,
                                        stderr=subprocess.PIPE,
                                        shell=False)

            logger_p = subprocess.Popen('logger',
                                        stdin=daemon_p.stderr,
                                        stdout=dn,
                                        stderr=dn,
                                        shell=False)
            jvm_pid = daemon_p.pid
            # Wait for the JVM initializes itself
            time.sleep(1)
            self.logger.debug('Daemon process ID is: {0}'.format(jvm_pid))
            self.logger.debug('Logger process ID is: {0}'.format(logger_p.pid))
            storlet_name = pargs[2]

            # Does JVM run?
            b_status, error_text = self.get_process_status_by_pid(
                jvm_pid, storlet_name)
            if b_status:
                self.logger.debug('Keeping JVM PID in' +
                                  'storlet_name_to_pid[{0}] = {1}'.
                                  format(storlet_name, jvm_pid))
                # Keep JVM PID
                self.storlet_name_to_pid[storlet_name] = jvm_pid
                b_status, error_text = \
                    self.wait_for_daemon_to_initialize(storlet_name)
                if not b_status:
                    # TODO(takashi): We shoudn't use String as Exception
                    #                (This usage is deprecated)
                    raise 'No response from Daemon'
            self.logger.debug('START_DAEMON: just occurred')
            error_text = 'OK'
        except Exception as e:
            b_status = False
            error_text = 'Failed to start subprocess %s' % str(pargs)
            self.logger.error(error_text)
            self.logger.error('Exception is %s' % str(e))

        # TODO(takashi): Now we return error text in tuple, but I think we had
        #                better make this raise Exception including message
        return b_status, error_text
dataset/ETHPy150Open openstack/storlets/Engine/storlet_daemon_factory/daemon_factory.py/daemon_factory.spawn_subprocess/original