Check the status of a managed fcrepo service
328444
def status
      return true unless config.managed?
      return false if pid.nil?

      begin
        Process.getpgid(pid)
      rescue Errno::ESRCH
        return false
      end

      begin
        TCPSocket.new(host, port).close

        Net::HTTP.start(host, port) do |http|
          http.request(Net::HTTP::Get.new('/'))
        end

        true
      rescue Errno::ECONNREFUSED, Errno::EINVAL
        false
      end
    end
1000332
def status():
    '''
    
    '''
    ret = {}

    cmd = __execute_cmd('riak-admin', 'status')

    for i in cmd['stdout'].splitlines():
        if ':' in i:
            (name, val) = i.split(':', 1)
            ret[name.strip()] = val.strip()

    return ret
521637
def getStatus(self):
    """"""
    command = '$GS'
    status = self.sendCommand(command)
    return states[int(status[1])]
737848
def _systemctl_status(name):
    '''
    
    '''
    contextkey = 'systemd._systemctl_status.%s' % name
    if contextkey in __context__:
        return __context__[contextkey]
    __context__[contextkey] = __salt__['cmd.run_all'](
        _systemctl_cmd('status', name),
        python_shell=False,
        redirect_stderr=True,
        ignore_retcode=True
    )
    return __context__[contextkey]
723779
def service_status(self, name):
        

        return self._loop.run_coroutine(self._client.service_status(name))
71630
def status(self):
        """"""
        try:
            # -- Check client
            res = self.run(['info'])
            if res[0]['clientName'] == '*unknown*':
                return ConnectionStatus.INVALID_CLIENT
            # -- Trigger an auth error if not logged in
            self.run(['user', '-o'])
        except errors.CommandError as err:
            if 'password (P4PASSWD) invalid or unset' in str(err.args[0]):
                return ConnectionStatus.NO_AUTH
            if 'Connect to server failed' in str(err.args[0]):
                return ConnectionStatus.OFFLINE

        return ConnectionStatus.OK
344676
def status(host=DEFAULT_HOST, port=DEFAULT_PORT):
    '''
    
    '''
    conn = _connect(host, port)
    try:
        stats = _check_stats(conn)[0]
    except (CommandExecutionError, IndexError):
        return False
    else:
        return {stats[0]: stats[1]}
231004
def status(self, return_led=0):
        """"""
        status = self.hub.get_device_status(self.device_id, return_led)
        self.logger.info("Dimmer %s status: %s", self.device_id,
                         pprint.pformat(status))
        return status
718452
def status(self) -> str:
        """"""
        # As status is a modifiable property, have to reload from the db.
        self._config = self._load_config()
        return self._config.get('status')
1124942
def get_pending_reboot():
    '''
    
    '''

    # Order the checks for reboot pending in most to least likely.
    checks = (get_pending_update,
              get_pending_file_rename,
              get_pending_servermanager,
              get_pending_component_servicing,
              get_reboot_required_witnessed,
              get_pending_computer_name,
              get_pending_domain_join)

    for check in checks:
        if check():
            return True

    return False
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();
        }
    }
1194155
def _rcconf_status(name, service_status):
    '''
    
    '''
    rcconf = '/etc/rc.conf'
    rxname = '^{0}=.*'.format(name)
    newstatus = '{0}={1}'.format(name, service_status)
    ret = __salt__['cmd.retcode']('grep \'{0}\' {1}'.format(rxname, rcconf))
    if ret == 0:  # service found in rc.conf, modify its status
        __salt__['file.replace'](rcconf, rxname, newstatus)
    else:
        ret = __salt__['file.append'](rcconf, newstatus)

    return ret
1322920
public static function checkNeeded(): void
    {
        set_time_limit(0);
        ignore_user_abort(true);
        ini_set('memory_limit', '1G');

        $services_collection = new ServiceEntityRepository;
        $services_collection
            ->setWhereRunning(0)
            ->setWhereAutoStart(1);

        /** @var ServiceEntity $service_entity */
        foreach ($services_collection->getAsArrayOfObjects() as $service_entity) {
            if (NOW - $service_entity->getLastTs() >= $service_entity->getPeriod()) {
                self::run($service_entity->getId());
            }
        }
    }
803413
def status(self):
        
        if not self.created:
            return None
        self.inner().reload()
        return self.inner().status
1371071
async def get_status(self, filters=None, utc=False):
        
        client_facade = client.ClientFacade.from_connection(self.connection())
        return await client_facade.FullStatus(filters)
88412
def do_status(self, service):
        
        if service:
            self.do_show("services", single=service)
        else:
            self.do_show("services")
1303649
def check_status(self, ignore=(), status=None):
        
        self.SHARD_CHECKS = [
            {'check_msg': 'Bad Core Count Check', 'f': self._check_shard_count},
            {'check_msg': 'Bad Shard Cluster Status', 'f': self._check_shard_status}
        ]
        if status is None:
            status = self.clusterstatus()
        out = {}
        for collection in status:
            out[collection] = {}
            out[collection]['coll_status'] = True  # Means it's fine
            out[collection]['coll_messages'] = []
            for shard in status[collection]:
                self.logger.debug("Checking {}/{}".format(collection, shard))
                s_dict = status[collection][shard]
                for check in self.SHARD_CHECKS:
                    if check['check_msg'] in ignore:
                        continue
                    res = check['f'](s_dict)
                    if not res:
                        out[collection]['coll_status'] = False
                        if check['check_msg'] not in out[collection]['coll_messages']:
                            out[collection]['coll_messages'].append(check['check_msg'])
                        self.logger.debug(s_dict)
        return out