GNU/Linux >> Znalost Linux >  >> Linux

Služba Linux OS „nscd“

Toto je Démon mezipaměti služby Name Service . Stará se o vyhledávání skupin a hesel pro spuštěné programy a poté ukládá výsledky vyhledávání do mezipaměti pro další dotaz pro služby, které mohou zaznamenat pomalost při přijímání změn, jako je NIS nebo LDAP. Pokud používáte tyto služby, možná budete chtít spustit nscd.

Tento démon může ukládat do mezipaměti data pro jmenné služby, /etc/hosts, DNS, NIS, NIS+ atd. Toto je pouze pro místní uživatele na počítači, protože mezipaměť je realizována zabalením funkcí do glibc, vzdálený uživatel nemůže tuto mezipaměť nikdy použít . Změna mezipaměti chvíli trvá, i když se změní původní data DNS, proto buďte opatrní při použití tohoto démona.

Řízení služeb

Příklad „chkconfig –list [service]“

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

Dostupné možnosti použití služby:

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

Spuštění služby:

# service nscd start
Starting nscd:                                             [  OK  ]

Zastavení služby:

# service nscd stop
Stopping nscd:                                             [  OK  ]

Zkontrolujte stav služby:

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

Restartování služby:

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

Znovu načtení služby za účelem opětovného načtení konfiguračního souboru:

# service nscd reload
Reloading nscd:                                            [  OK  ]

Podmíněné restartování služby:

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

– Které démony spouští:/usr/sbin/nscd
– Které moduly načítá:žádné

Konfigurace

Příklad konfiguračního souboru:

# 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

Odstraňování problémů

Někdy restartujte, zastavte nebo spusťte démona NSCD, nevyprázdní mezipaměť, k explicitnímu vyprázdnění staré mezipaměti musíte použít následující metodu:
Před CentOS/RHEL 7 :

# service nscd reload

Po CentOS/RHEL 7 :

# systemctl restart nscd


Linux
  1. Služba operačního systému Linux „nfs“

  2. Služba operačního systému Linux „microcode_ctl“

  3. Služba Linux OS „NetFS“

  1. Služba Linux OS „ldap“

  2. Služba OS Linux „yppasswdd“

  3. Linux OS Service ‚xendomény‘

  1. Služba operačního systému Linux „dhcpd“

  2. Služba Linux OS „chobotnice“

  3. Služba OS Linux „chytrá“