GNU/Linux >> Tutoriels Linux >  >> Linux

Service de système d'exploitation Linux « nscd »

Il s'agit du démon de cache du service de noms . Il prend en charge les recherches de groupe et de mot de passe pour les programmes en cours d'exécution, puis met en cache les résultats de la recherche pour la requête suivante pour les services qui peuvent connaître une lenteur dans la détection des modifications telles que NIS ou LDAP. Si vous exécutez ces services, vous pouvez exécuter nscd.

Ce démon peut mettre en cache des données pour les services de noms, /etc/hosts, DNS, NIS, NIS+ etc. Ceci est uniquement pour les utilisateurs locaux sur la machine, car le cache est réalisé en enveloppant les fonctions dans la glibc, l'utilisateur distant ne peut jamais utiliser ce cache . Il faut un certain temps pour changer le cache même lorsque les données DNS d'origine sont modifiées, veillez donc à utiliser ce démon.

Contrôle des services

Exemple de "chkconfig –list [service]"

# chkconfig --list nscd
nscd            0:off   1:off   2:off   3:off   4:off   5:off   6:off

Options d'utilisation du service disponibles :

# service nscd
Usage: /etc/init.d/nscd {start|stop|status|restart|reload|condrestart}

Démarrage du service :

# service nscd start
Starting nscd:                                             [  OK  ]

Arrêt du service :

# service nscd stop
Stopping nscd:                                             [  OK  ]

Vérifiez l'état du service :

# service nscd status
nscd (pid 15382) is running...

Redémarrage du service :

# service nscd restart
Stopping nscd:                                             [  OK  ]
Starting nscd:                                             [  OK  ]

Rechargement du service pour relire le fichier de configuration :

# service nscd reload
Reloading nscd:                                            [  OK  ]

Redémarrage conditionnel du service :

# service nscd condrestart
Stopping nscd:                                             [  OK  ]
Starting nscd:                                             [  OK  ]

– Quels démons exécute-t-il :/usr/sbin/nscd
– Quels modules charge-t-il :aucun

Configuration

Exemple de fichier de configuration :

# nscd will run as "nscd" user and not as root.
        server-user             nscd

# nscd set no debug output. if level is higher than 0, nscd will create some debug output, the higher the level, the more output is produced
        debug-level             0

# disable paranoia mode, nscd will not restart itself periodically
        paranoia                no

# enables the specified service "passwd" cache
        enable-cache            passwd          yes

# Sets the TTL (time-to-live) for positive entries (successful queries) in the specified cache for "passwd" to 600 seconds

        positive-time-to-live   passwd          600

# Sets the TTL (time-to-live) for negative entries (unsuccessful queries) in  the  specified  cache for "passwd" to 20 seconds
        negative-time-to-live   passwd          20

# Sets the internal hash table size to 211
        suggested-size          passwd          211

# Enables checking the file belonging to the specified service "passwd" for changes
        check-files             passwd          yes

# Keep the content of the cache for service "passwd" over server restarts;
        persistent              passwd          yes

# The memory mapping of the nscd databases for service "passwd" is shared with the clients
        shared                  passwd          yes

# The maximum allowable size for the service "passwd" set to be 33554432 bytes
        max-db-size             passwd          33554432

# The .byname requests will add to passwd.byuid or group.bygid cache.
        auto-propagate          passwd          yes

Dépannage

Parfois, redémarrez, arrêtez ou démarrez le démon NSCD, il ne videra pas son cache, vous devez utiliser la méthode suivante pour vider explicitement l'ancien cache :
Avant CentOS/RHEL 7 :

# service nscd reload

Après CentOS/RHEL 7 :

# systemctl restart nscd


Linux
  1. Service du système d'exploitation Linux "nfs"

  2. Service du système d'exploitation Linux 'microcode_ctl'

  3. Service d'exploitation Linux "hplip"

  4. Service d'exploitation Linux "irqbalance"

  5. Service de système d'exploitation Linux "rpcgssd"

Service d'exploitation Linux "NetFS"

Service de système d'exploitation Linux « ldap »

Service d'exploitation Linux "yppasswdd"

Service d'exploitation Linux "xendomains"

Service d'exploitation Linux "squid"

Service d'exploitation Linux "smartd"