GNU/Linux >> Belajar Linux >  >> Linux

Layanan OS Linux 'nscd'

Ini adalah Daemon Cache Layanan Nama . Ini menangani pencarian grup dan kata sandi untuk menjalankan program dan kemudian menyimpan hasil pencarian untuk permintaan berikutnya untuk layanan yang dapat mengalami kelambatan dalam mengambil perubahan seperti NIS atau LDAP. Jika Anda menjalankan layanan ini, Anda mungkin ingin menjalankan nscd.

Daemon ini dapat menyimpan data untuk layanan nama, /etc/hosts, DNS, NIS, NIS+ dll. Ini hanya untuk pengguna lokal pada mesin, karena cache diwujudkan dengan membungkus fungsi di glibc, pengguna jarak jauh tidak akan pernah dapat menggunakan cache ini . Perlu waktu untuk mengubah cache meskipun data DNS asli diubah, oleh karena itu berhati-hatilah dalam menggunakan daemon ini.

Kontrol Layanan

Contoh “chkconfig –list [service]”

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

Opsi penggunaan layanan yang tersedia:

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

Memulai layanan:

# service nscd start
Starting nscd:                                             [  OK  ]

Menghentikan layanan:

# service nscd stop
Stopping nscd:                                             [  OK  ]

Periksa status layanan:

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

Memulai ulang layanan:

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

Memuat ulang layanan untuk membaca ulang file konfigurasi:

# service nscd reload
Reloading nscd:                                            [  OK  ]

Restart bersyarat layanan:

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

– Daemon mana yang dijalankan :/usr/sbin/nscd
– Modul mana yang dimuat:none

Konfigurasi

Contoh file konfigurasi:

# 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

Pemecahan Masalah

Terkadang memulai ulang, menghentikan atau memulai daemon NSCD, itu tidak akan membersihkan cache-nya, Anda perlu menggunakan metode berikut untuk secara eksplisit membersihkan cache lama:
Sebelum CentOS/RHEL 7 :

# service nscd reload

Setelah CentOS/RHEL 7 :

# systemctl restart nscd


Linux
  1. 'portmap' layanan OS Linux

  2. Layanan OS Linux 'diaudit'

  3. Layanan OS Linux 'nfs'

  1. Layanan OS Linux 'microcode_ctl'

  2. Layanan OS Linux 'NetFS'

  3. Layanan OS Linux 'hplip'

  1. Layanan OS Linux 'ldap'

  2. Layanan OS Linux 'yppasswdd'

  3. Layanan OS Linux 'xendomains'