Returns if the process is currently running.

@return bool TRUE if the process is running, FALSE if not.
328697
public function isRunning()
    {
        $this->checkSupportingOS('Cocur\BackgroundProcess can only check if a process is running on *nix-based '.
                                 'systems, such as Unix, Linux or Mac OS X. You are running "%s".');

        try {
            $result = shell_exec(sprintf('ps %d 2>&1', $this->pid));
            if (count(preg_split("/\n/", $result)) > 2 && !preg_match('/ERROR: Process ID out of range/', $result)) {
                return true;
            }
        } catch (Exception $e) {
        }

        return false;
    }
1330749
def check_running(self):
        '''
        
        '''

        if self.check_pidfile():
            pid = self.get_pidfile()
            if not salt.utils.platform.is_windows():
                if self.check_pidfile() and self.is_daemonized(pid) and os.getppid() != pid:
                    return True
            else:
                # We have no os.getppid() on Windows. Use salt.utils.win_functions.get_parent_pid
                if self.check_pidfile() and self.is_daemonized(pid) and salt.utils.win_functions.get_parent_pid() != pid:
                    return True
        return False
190348
public function run()
    {
        // If the truthTest failed, don't run
        if ($this->truthTest !== true) {
            return false;
        }

        // If overlapping, don't run
        if ($this->isOverlapping()) {
            return false;
        }

        // Write lock file if necessary
        $this->createLockFile();

        // Call before if required
        if (is_callable($this->before)) {
            call_user_func($this->before);
        }

        // If command is callable...
        if (is_callable($this->command)) {
            $this->output = $this->exec();
        } else {
            $args = \is_string($this->args) ? $this->args : implode(' ', $this->args);
            $command = $this->command . ' ' . $args;
            $process = new Process($command);

            $this->process = $process;

            if ($this->runInBackground()) {
                $process->start();
            } else {
                $process->run();
                $this->finalize();
            }
        }

        return true;
    }
449154
public function was_started() {

        if ($this->started === null) {
            if ($this->get_start() === 0 || $this->now < $this->get_start()) {
                // Not yet started.
                $this->started = false;
            } else {
                $this->started = true;
            }
        }

        return $this->started;
    }
1023913
public function checkHealth()
    {
        if (!$this->process->isRunning()) {
            if ($this->status == self::STATUS_CLEANINGUP || $this->status == self::STATUS_CLEANEDUP) {
                //okay so we're ready to stop!
                $this->status = self::STATUS_DEAD;
                return true;
            } elseif ($this->status == ChildProcessContainer::STATUS_SLEEPY) {
                //okay so we're ready to stop!
                $this->status = self::STATUS_DEAD;
                return true;
            }
            $this->status = self::STATUS_DEAD;
            return false;
        } else {
            return true;
        }

    }
128497
private function checkStatus()
    {
        if (!$this->running) {
            return;
        }

        if ($this->running) {
            foreach (proc_get_status($this->resource) as $key => $value) {
                if ($key == 'command') {
                    continue;
                }

                $this->$key = $value;
            }
        }

        if (!$this->running) {
            $this->cleanup();
        }
    }
537540
public function isCurrent()
    {
        if (null === $this->isCurrent)
        {
            $this->isCurrent = $this->isMatchingRouteName() && $this->isMatchingRequestVariables();
        }

        return $this->isCurrent;
    }
416718
public function isAlive()
    {
        if ( $this->attribute( 'status' ) != self::STATUS_WORKING )
            throw new Exception( 'The process\'s status isn\'t \'working\'' );

        // sending 0 only checks if the process is alive (and if the current process is allowed to send signals to it)
        $return = ( posix_kill( $this->attribute( 'pid' ), 0 ) === true );
        return $return;
    }
1111586
def is_running(self):
        
        state = yield from self._get_container_state()
        if state == "running":
            return True
        if self.status == "started":  # The container crashed we need to clean
            yield from self.stop()
        return False
548632
public function isDrupalVmBooted() {
    if (!$this->commandExists('vagrant')) {
      $this->isDrupalVmBooted = FALSE;
    }

    if (is_null($this->isDrupalVmBooted)) {
      $status = $this->getDrupalVmStatus();
      $machine_name = $this->getConfigValue('project.machine_name');
      $this->isDrupalVmBooted = !empty($status[$machine_name]['state'])
        && $status[$machine_name]['state'] == 'running';

      $statement = $this->isDrupalVmBooted ? "is" : "is not";
      $this->logger->debug("Drupal VM $statement booted.");
    }

    return $this->isDrupalVmBooted;
  }
450411
public static function is_running() {
		if (!file_exists(Config::$pid_file)) {
			return false;
		}

		$pid = file_get_contents(Config::$pid_file);
		if (posix_getpgid($pid) === false) {
			unlink(Config::$pid_file);
			return false;
		}

		return true;
	}
1175061
protected function isRunning($pid)
    {
        if (! $pid) {
            return false;
        }

        try {
            return Process::kill($pid, 0);
        } catch (Throwable $e) {
            return false;
        }
    }
1116732
protected function managerIsRunning() : bool
    {
        global $argv;
        $cliOutput = [];
        exec('ps x | grep ' . $argv[0], $cliOutput);
        $processCount = 0;
        if (empty($cliOutput)) {
            return false;
        }
        foreach ($cliOutput as $line) {
            if (strpos($line, 'grep') !== false) {
                continue;
            }
            if (strpos($line, '/bin/sh') !== false) {
                continue;
            }
            $processCount++;
        }
        return ($processCount > 1) ? true : false;
    }
459434
def is_running(self):
        
        return self._state in [self.STATE_ACTIVE,
                               self.STATE_IDLE,
                               self.STATE_INITIALIZING]
565424
def is_running(pid):
    
    process = get_process(pid)
    if process and process.is_running() and process.status() != "zombie":
        return True
    else:
        return False
1207581
public function isRunning() {
		if( !$this->pid ) {
			return false;
		}

		$result = shell_exec(sprintf('ps %d',
			$this->pid));
		if( count(preg_split("/\n/", $result)) > 2 ) {
			return true;
		}

		return false;
	}
252678
public function isRunning()
    {
        if ($this->resourceOpen instanceof ProcOpen) {
            $status = proc_get_status($this->process);
            $running = $status['running'];
            $this->running = ($running === false) ? $running : $this->running;
        }

        return $this->running;
    }