GNU/Linux >> Tutoriales Linux >  >> Linux

Servicio del sistema operativo Linux 'nscd'

Este es el daemon de caché del servicio de nombres . Se ocupa de las búsquedas de grupos y contraseñas para los programas en ejecución y luego almacena en caché los resultados de la búsqueda para la siguiente consulta de servicios que pueden experimentar lentitud en la detección de cambios, como NIS o LDAP. Si está ejecutando estos servicios, es posible que desee ejecutar nscd.

Este demonio puede almacenar datos en caché para servicios de nombres, /etc/hosts, DNS, NIS, NIS+, etc. Esto es solo para usuarios locales en la máquina, ya que el caché se realiza envolviendo las funciones en glibc, el usuario remoto nunca puede usar este caché . Se necesita tiempo para cambiar el caché incluso cuando se cambian los datos DNS originales, por lo tanto, tenga cuidado al usar este demonio.

Control de servicios

Ejemplo de “chkconfig –list [servicio]”

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

Opciones de uso del servicio disponibles:

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

Iniciando el servicio:

# service nscd start
Starting nscd:                                             [  OK  ]

Deteniendo el servicio:

# service nscd stop
Stopping nscd:                                             [  OK  ]

Consulta el estado del servicio:

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

Reiniciando el servicio:

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

Recargando el servicio para volver a leer el archivo de configuración:

# service nscd reload
Reloading nscd:                                            [  OK  ]

Reinicio condicional del servicio:

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

– Qué demonios ejecuta:/usr/sbin/nscd
– Qué módulos carga:ninguno

Configuración

Ejemplo de archivo de configuración:

# 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

Resolución de problemas

A veces reinicia, detiene o inicia el demonio NSCD, no vaciará su caché, necesita usar el siguiente método para vaciar explícitamente el caché antiguo:
Antes de CentOS/RHEL 7 :

# service nscd reload

Después de CentOS/RHEL 7 :

# systemctl restart nscd


Linux
  1. Servicio del sistema operativo Linux 'anacron'

  2. Servicio del sistema operativo Linux 'iptables'

  3. Servicio de sistema operativo Linux 'red'

  4. Servicio de sistema operativo Linux 'mapa de puertos'

  5. Servicio de SO Linux 'auditoría'

Servicio de sistema operativo Linux 'NetFS'

Servicio de sistema operativo Linux 'ldap'

Servicio del sistema operativo Linux 'yppasswdd'

Servicio de sistema operativo Linux 'xendomains'

Servicio de sistema operativo Linux 'calamar'

Servicio de sistema operativo Linux 'smartd'