Return True if the service is managed by chkconfig.
432624
def _service_is_chkconfig(name):
    '''
    
    '''
    cmdline = '/sbin/chkconfig --list {0}'.format(name)
    return __salt__['cmd.retcode'](cmdline, python_shell=False, ignore_retcode=True) == 0
556919
public static boolean isServiceEnabled(XMPPConnection connection) {
        connection.getXMPPServiceDomain();
        return ServiceDiscoveryManager.getInstanceFor(connection).includesFeature(AMPExtension.NAMESPACE);
    }
1121290
def get_configured_provider():
    '''
    
    '''
    return config.is_provider_configured(
        opts=__opts__,
        provider=__active_provider_name__ or __virtualname__,
        aliases=__virtual_aliases__,
        required_keys=('personal_access_token',)
    )
956451
public function isMet()
    {
        $settings = $this->configurationManager->getConfiguration(\Neos\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.Flow');
        try {
            \Doctrine\DBAL\DriverManager::getConnection($settings['persistence']['backendOptions'])->connect();
        } catch (\PDOException $exception) {
            return false;
        }

        return true;
    }
993782
def is_systemd_service_enabled(conn, service='ceph'):
    
    _, _, returncode = remoto.process.check(
        conn,
        [
            'systemctl',
            'is-enabled',
            '--quiet',
            '{service}'.format(service=service),
        ]
    )
    return returncode == 0
1238435
def _sysv_delete(name):
    '''
    
    '''
    if not _service_is_chkconfig(name):
        return False
    cmd = '/sbin/chkconfig --del {0}'.format(name)
    return not __salt__['cmd.retcode'](cmd)
357584
private void checkZkConfiguration() {
    Preconditions.checkState(
        isSet(PropertyKey.ZOOKEEPER_ADDRESS) == getBoolean(PropertyKey.ZOOKEEPER_ENABLED),
        PreconditionMessage.INCONSISTENT_ZK_CONFIGURATION.toString(),
        PropertyKey.Name.ZOOKEEPER_ADDRESS, PropertyKey.Name.ZOOKEEPER_ENABLED);
  }
371961
protected function isSortingConfigured()
    {
        if (! $this->json) {
            $this->readJson();
        }
        
        return ! empty($this->json['config']) && ! empty($this->json['config']['sort-packages']);
    }
136974
def manage_internal_checks(self):
        
        if os.getenv('ALIGNAK_MANAGE_INTERNAL', '1') != '1':
            return
        now = time.time()
        for chk in list(self.checks.values()):
            if not chk.internal:
                # Exclude checks that are not internal ones
                continue

            # Exclude checks that are not yet ready to launch
            if not chk.is_launchable(now) or chk.status not in [ACT_STATUS_SCHEDULED]:
                continue

            item = self.find_item_by_id(chk.ref)
            # Only if active checks are enabled
            if not item or not item.active_checks_enabled:
                # Ask to remove the check
                chk.status = ACT_STATUS_ZOMBIE
                continue
            logger.debug("Run internal check for %s", item)

            self.nb_internal_checks += 1

            # Execute internal check
            item.manage_internal_check(self.hosts, self.services, chk, self.hostgroups,
                                       self.servicegroups, self.macromodulations,
                                       self.timeperiods)
            # Ask to consume the check result
            chk.status = ACT_STATUS_WAIT_CONSUME
757912
def manage_service_check_result_brok(self, b):  # pylint: disable=too-many-branches
        """"""
        host_name = b.data.get('host_name', None)
        service_description = b.data.get('service_description', None)
        if not host_name or not service_description:
            return
        service_id = host_name+"/"+service_description
        logger.debug("service check result: %s", service_id)

        # If host and service initial status broks have not been received, ignore ...
        if not self.ignore_unknown and host_name not in self.hosts_cache:
            logger.warning("received service check result for an unknown host: %s", service_id)
            return
        if service_id not in self.services_cache and not self.ignore_unknown:
            logger.warning("received service check result for an unknown service: %s", service_id)
            return

        # Decode received metrics
        metrics = self.get_metrics_from_perfdata(service_description, b.data['perf_data'])
        if not metrics:
            logger.debug("no metrics to send ...")
            return

        # If checks latency is ignored
        if self.ignore_latency_limit >= b.data['latency'] > 0:
            check_time = int(b.data['last_chk']) - int(b.data['latency'])
        else:
            check_time = int(b.data['last_chk'])

        # Custom hosts variables
        hname = sanitize_name(host_name)
        if host_name in self.hosts_cache:
            if self.hosts_cache[host_name].get('_GRAPHITE_GROUP', None):
                hname = ".".join((self.hosts_cache[host_name].get('_GRAPHITE_GROUP'), hname))

            if self.hosts_cache[host_name].get('_GRAPHITE_PRE', None):
                hname = ".".join((self.hosts_cache[host_name].get('_GRAPHITE_PRE'), hname))

        # Custom services variables
        desc = sanitize_name(service_description)
        if service_id in self.services_cache:
            if self.services_cache[service_id].get('_GRAPHITE_POST', None):
                desc = ".".join((desc, self.services_cache[service_id].get('_GRAPHITE_POST', None)))

        # Graphite data source
        if self.graphite_data_source:
            path = '.'.join((hname, self.graphite_data_source, desc))
        else:
            path = '.'.join((hname, desc))

        # Realm as a prefix
        if self.realms_prefix and self.hosts_cache[host_name].get('realm_name', None):
            path = '.'.join((self.hosts_cache[host_name].get('realm_name'), path))

        realm_name = None
        if host_name in self.hosts_cache:
            realm_name = self.hosts_cache[host_name].get('realm_name', None)

        # Send metrics
        self.send_to_tsdb(realm_name, host_name, service_description, metrics, check_time, path)
1067105
private function isBaseConfigPropertiesSet(): bool
    {
        return isset(
            $this->config[ConfigurationInterface::KEY_APP_ROOT],
            $this->config[ConfigurationInterface::KEY_CONFIG_ROOT],
            $this->config[ConfigurationInterface::KEY_CACHE_ROOT],
            $this->config[ConfigurationInterface::KEY_THEMES_ROOT],
            $this->config[ConfigurationInterface::KEY_CONTENT_ROOT]
        );
    }
346799
public static boolean isServiceExported(Configuration configuration, int port, String serviceName) {
        if (serviceName == null)
            return false;
        try {
            final Registry registry = RegistryFinder.getInstance().getRegistry(configuration, port);
            String[] list = registry.list();

            if (list != null) {
                for (int i = 0; i < list.length; i++) {
                    if (serviceName.equals(list[i]))
                        return true;
                }
            }
        } catch (RemoteException ex) {
            return false;
        } catch (Exception e) {
            return false;
        }
        return false;
    }
868469
public function is_configured() {
        if ($this->get_config('runningmethod') === 'commandline') {
            return (bool)$this->get_config('pathtoclam');
        } else if ($this->get_config('runningmethod') === 'unixsocket') {
            return (bool)$this->get_config('pathtounixsocket');
        }
        return false;
    }
368808
function hasConfigSetting(pkg, setting) {
  return pkg.config && pkg.config[appName] && pkg.config[appName][setting];
}
943601
def config_cred(config, providers):
    """"""
    expected = ['aws', 'azure', 'gcp', 'alicloud']
    cred = {}
    to_remove = []
    for item in providers:
        if any(item.startswith(itemb) for itemb in expected):
            try:
                cred[item] = dict(list(config[item].items()))
            except KeyError as e:
                print("No credentials section in config file for {} -"
                      " provider will be skipped.".format(e))
                to_remove.append(item)
        else:
            print("Unsupported provider: '{}' listed in config - ignoring"
                  .format(item))
            to_remove.append(item)
    return cred, to_remove
398312
public function isConfigured()
    {
        if (!empty($this->urlParts) && isset($this->solrMap[$this->className])) {
            return true;
        }
        return false;
    }
44486
private function manageInheritance()
    {
        $config = $this->serviceConfig;
        if ($config->keyExists('Parent')) {
            $parentServiceName = $this->str($config->key('Parent'))->trimLeft('@')->val();
            $parentConfig = ServiceManager::getInstance()->getServiceConfig($parentServiceName)->toArray(true);
            if (!$parentConfig->keyExists('Abstract')) {
                throw new ServiceManagerException(ServiceManagerException::SERVICE_IS_NOT_ABSTRACT,
                                                  [$config->key('Parent')]
                );
            }
            $config = $this->extendConfig($config, $parentConfig);
        }

        // Check if it's a potentially valid service definition
        if (!$config->keyExists('Class') && !$config->keyExists('Factory')) {
            throw new ServiceManagerException(ServiceManagerException::SERVICE_CLASS_KEY_NOT_FOUND,
                                              [$this->serviceName]
            );
        }

        $this->serviceConfig = $config;
    }